<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
		<link rel="stylesheet" href="../statics/css/bootstrap-theme.min.css" />
		<script type="text/javascript" src="../statics/js/jquery-1.12.4.js"></script>
		<!--<script type="text/javascript" src="../statics/js/wg/jquery.min.js" ></script>-->
		<script type="text/javascript" src="../statics/js/wg/bootstrap.min.js"></script>
		<script type="text/javascript" src="../statics/js/wg/bootstrap-chinese-region.js"></script>
		<title>车险投保</title>
		<style type="text/css">
			
			.herd1 {
				width: 100%;				
			}
			
			.xin {
				line-height: 1em;
			}
			
			.xin p {
				margin-left: 1em;
			}
			
			.aad {
				position: absolute;
				top: 30em;
				left: 0em;
				width: 100%;
				background: red;
			}
			.namea{
					width: 14em;
					border-style:none;
					text-align: ;
					height: 2em;
					margin-top: -1.5em;
					background:none;
			}
			.afhsy{
				color: white;
				display: block;
				width: 100%;
				height: 3em;
				line-height: 3em;
				text-decoration: none;
				border: 0rem;	
				margin: 0rem;
				padding: 0rem;
				background: #87CEFA;
				text-align: center;
			}

			
			
		}
		</style>
	</head>

	<body>
		<div class="container">
			<div class="col-xs-12 herd1">
				<p class="afhsy h3">车险投保</p>
			</div>
			<form action="inset" id="form001" method="post">
				<div class="xin">
					<p class="h4 test01">发动机号:&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="engine" id="engine" class="namea" placeholder="请输入发动机号"/></p>
					<p class="h4 test01">车&nbsp;&nbsp;牌&nbsp;&nbsp;号:&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="vin" id="vin" class="namea" placeholder="请输入车牌号"/></p>
					<p class="h4 test01">车&nbsp;&nbsp;型&nbsp;&nbsp;号:&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="cartype" id="cartype" class="namea" placeholder="请输入车型号"/></p>
					<p class="h4 test01">被&nbsp;&nbsp;保&nbsp;&nbsp;人:&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="insuredname" id="insuredname" class="namea" placeholder="请输入被保人"/></p>
					<p class="h4 test01">手&nbsp;&nbsp;机&nbsp;&nbsp;号:&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="insuredphone" id="insuredphone" class="namea" placeholder="请输入手机号"/></p>
					<p class="h4 test01">身份证号:&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="identity" id="identity"  class="namea" placeholder="请输入身份证号	"/></p>
					<input type="text" name="insuranceid" value="1" hidden="hidden" />
				</div>
				<input id="Button1" type="submit" value="立即购买" class="submit afhsy h3 " />
			</form>
		</div>
		
	</body>
	<script type="text/javascript">
		$(function() {
			$("#form001").submit(function() {
				var engine = $("#engine").val();
				var vin = $("#vin").val();
				var cartype = $("#cartype").val();
				var insuredname = $("#insuredname").val();
				var insuredphone = $("#insuredphone").val();
				var identity = $("#identity").val();
				var $cartype = $("#vin").val();
				var $casephone1 = $("#insuredphone").val();
				var $identity1 = $("#identity").val();
				var cepai=/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$/;
				var regmobile = /^1\d{10}$/;
				var id=/^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
				
				if(engine==null || engine ==""){
					alert("请输入发动机号");
					return false;
				}
				else if(vin==null || vin ==""){
					alert("请输入车牌号");
					return false;
					
				}
				else if(cartype==null || cartype ==""){
					alert("请输入车型号");
					return false;
				}
				else if(insuredname==null || insuredname ==""){
					alert("请输入被保人");
					return false;
				}
				else if(cepai.test($cartype)==false){
					alert("请输入正确的车牌号码");
					return false;
				}
				else if(insuredphone==null || insuredphone ==""){
					alert("请输入电话");
					return false;
				}
				else if(regmobile.test($casephone1)==false){
						alert("手机号码格式不正确");
						return false;
					
				}
				else if(identity==null || identity ==""){
					alert("请选择被保人证件号");
					return false;
				}else if(id.test($identity1)==false){
					alert("证件号格式不正确");
					return false;
				}
			});

		});
	</script>

</html>